home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tegl6b.zip / INTROPAK.EXE / lha / MOVEIMAG.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-06  |  1KB  |  55 lines

  1. {-- This program illustrates how an image can be hidden then displayed }
  2. {-- again at a different screen location. }
  3. Uses
  4.     tgraph,
  5.     TEGLIntr,
  6.     TEGLUnit,
  7.     TEGLMain;
  8.  
  9. VAR fs : ImageStkPtr;
  10.     i,dx,dy  : word;
  11.  
  12.  
  13.  
  14. BEGIN
  15.  
  16.   EasyTEGL;
  17.   EasyOut;
  18.  
  19.  
  20.   PushImage(1,1,50,50);
  21.   ShadowBox(1,1,50,50);
  22.   fs := StackPtr;
  23.  
  24.   i := 20000;      {-- counter }
  25.   dx := 0;         {-- simple delta for the frame }
  26.   dy := 0;
  27.   REPEAT
  28.      i := i - 1;
  29.      IF i=100 THEN
  30.     HideImage(fs);   {-- just hides the image, doesn't dispose }
  31.      IF i=0 then
  32.     BEGIN
  33.           dx := dx + 3;
  34.           dy := dy + 2;
  35.  
  36.           {-- check for screen boundaries }
  37.           IF ((dx > getmaxx - 60) OR (dy > getmaxy-60)) THEN
  38.             BEGIN
  39.               dx := 1;
  40.               dy := 1;
  41.             END;
  42.           {-- show image places the image at the new location. If you want }
  43.           {-- to display it at it's orginal location use the imagestackptr }
  44.           {-- x and y, they are the same as when it was hidden. }
  45.       ShowImage(fs,dx,dy);
  46.       i := 4000;
  47.     END;
  48.   UNTIL Mouse_Buttons<>0;
  49.  
  50.   IF i<=100 THEN
  51.     ShowImage(fs,fs^.x,fs^.y);
  52.  
  53.   TEGLSupervisor;
  54. END.
  55.